<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>
<body>
<nav th:replace="layouts::navbar"></nav>

<div class="container">
    <form th:action="@{/inventories/save}" th:object="${inventory}" method="POST">
        <input type="hidden" th:field="${inventory.inventoryId}">
        <div class="logo"></div>
        <hr>
        商品名称:<select th:field="*{commodities}" multiple="multiple">
                    <option th:each="commodity : ${allCommodities}" th:value="${commodity.commodityId}" th:text="${commodity.name}"></option>
                </select>
<!--        <label for="commodityId">商品ID:</label>-->
<!--        <input type="text" id="commodityId" th:field="${inventory.commodityId}">-->
<!--        <label for="name">商品名称:</label>-->
<!--        <input type="text" id="name" th:field="${inventory.name}">-->
        <label for="number">库存数量:</label>
        <input type="text" id="number" th:field="${inventory.number}">

        <button type="submit">新增库存</button>
    </form>
</div>
</body>
</html>